
package com.udc.medLine.persistence;

import java.util.List;

import com.udc.medLine.entity.Status;


public class StatusDAO implements DAO {
	private Status status;
	Bd banco;
	
	public StatusDAO(){
		status = new Status();
		try{
			banco = Bd.getInstance();
		}
		catch(Exception e){
			e.printStackTrace();
		}
	}
	
	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	public void insert() throws Exception {
		banco.insert(status);
	}

	public void delete() throws Exception {
		banco.delete(status);
	}
	
	public void update() throws Exception {
		banco.update(status);
	}
	
	public List search(String hql) throws Exception {
		List lista;
		lista = banco.getList(hql);		
		return lista;
	}
	
	public Status retrive() throws Exception {
		return (Status) banco.retrieve(status, status.getId()+"");
	}
	
}
